package com.dslu.fx.controller;

import com.dslu.fx.domain.ProdDO;
import com.dslu.fx.service.ProdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
public class ProdController {

    @Autowired
    private ProdService prodService;

    @ResponseBody
    @GetMapping("/prod")
    public Map<String,Object> getProd(){
        ProdDO prodDO = prodService.get(1);
        Map map =new HashMap();
        map.put("prodDO",prodDO);
        return map;
    }
}
